<%@ page import="Contas.Administrador" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="adminContas" />
        <g:set var="entityName" value="${message(code: 'administrador.label', default: 'Administrador')}" />
        <title><g:message code="SPL - Criando Administrador" args="[entityName]" /></title>
    </head>
    <body>
      
        <div class="body">
            <h1><g:message code="Preencha os campos abaixo." args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            	<div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${administradorInstance}">
        <div class="errors">
                <g:renderErrors bean="${administradorInstance}" as="list" />
        </div>
            </g:hasErrors>
            <br>
            	 <h4><font color="red">* Campo Obrigatorio</font></h4>
            </br>
            
            <g:form action="save">
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="login"><g:message code="administrador.username.label" default="Login" /><font color="red"><i>*</i> </font></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: administradorInstance, field: 'username', 'errors')}">
                                    <g:textField name="username" maxlength="30" value="${administradorInstance?.username}" />
                  					<font color="red"><i>(Min. 4 Caracteres - Apenas letras)</i> </font>	
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="senha"><g:message code="usuarioComum.passwd.label" default="Senha" /><font color="red"><i>*</i> </font></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: administradorInstance, field: 'passwd', 'errors')}">
                                    <g:passwordField name="passwd" maxlength="15" value="${administradorInstance?.passwd}" />
                                	<font color="red"><i>(Min. 6 Caracteres)</i> </font>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="email"><g:message code="usuarioComum.email.label" default="Email" /><font color="red"><i>*</i> </font></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: administradorInstance, field: 'email', 'errors')}">
                                    <g:textField name="email" maxlength="50" value="${administradorInstance?.email}" />
                                	<font color="red"><i>(Ex: natan@gmail.com)</i> </font>	
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="telefone"><g:message code="usuarioComum.telefone.label" default="Telefone" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: administradorInstance, field: 'telefone', 'errors')}">
                                    <g:textField size="2" name="ddd" maxlength="2" value="${telefoneInstance?.ddd}" />
                                    <g:textField size="4" name="telefoneParte1" maxlength="4" value="${telefoneInstance?.telefoneParte1}" />
                                    <g:textField size="4" name="telefoneParte2" maxlength="4" value="${telefoneInstance?.telefoneParte2}" />
  									<font color="red"><i>(Ex: (83) 3341 - 2510)</i> </font>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nome"><g:message code="usuarioComum.userRealName.label" default="Nome" /><font color="red"><i>*</i> </font></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: administradorInstance, field: 'username', 'errors')}">
                                    <g:textField name="userRealName" maxlength="50" value="${administradorInstance?.userRealName}" />
                                    <font color="red"><i>(Apenas letras)</i> </font>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="tipo"><g:message code="administrador.tipo.label" default="Tipo" /><font color="red"><i>*</i> </font></label>
                                </td>
                                <td valign="top" class="name">
                                    <g:select id="tipoSelection" name="tipo" default="Tipo" noSelection="${['Novo Tipo':message(code:'Novo Tipo')]}" from="${tiposAdmin}" value="${administradorInstance?.tipo}"/>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="tipo"><g:message code="administrador.tipo.label" default="Novo Tipo" /></label>
                                </td>
                             	<td valign="top" class="value ${hasErrors(bean: administradorInstance, field: 'tipo', 'errors')}">
                                    <g:textField name="tipo" value="${administradorInstance?.tipo}"/>
                                     <font color="red"><i>(Apenas letras)</i> </font>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="Criar" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
